package com.woniu.serverdriveruser.service;


import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.serverdriveruser.mapper.DriverMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CityDriverService {
    @Autowired
    private DriverMapper driverMapper;

    /**
     *  判断城市是否有司机
     * @param cityCode
     * @return
     */
    public ResponseResult isAvailableDriver(String cityCode) {
        int num = driverMapper.selectDriverUserCountByCityCode(cityCode);

        if (num > 0){
            return ResponseResult.success(true);
        }else{
            return ResponseResult.fail(false);
        }
    }
}
